package com.ktjy.service.impl;

import com.ktjy.dao.NewsDao;
import com.ktjy.dao.impl.NewsDaoImpl;
import com.ktjy.factory.NewsDaoFactory;
import com.ktjy.pojo.News;
import com.ktjy.service.NewsService;

public class NewsServiceImpl implements NewsService {

    //NewsDao newsDao = new NewsDaoImpl();
    NewsDao newsDao;

    public NewsServiceImpl(NewsDao newsDao) {
        this.newsDao = newsDao;
    }

    public void setNewsDao(NewsDao newsDao) {
        this.newsDao = newsDao;
    }

    @Override
    public void save(News news) {
        //newsDao = NewsDaoFactory.getNewsDao();
        newsDao.save(news);
    }
}
